import request from '@/config/axios'

// 考核工资明细 VO
export interface HrSalaryAssessmentVO {
  userName: string // 员工姓名
  deptId: string // 部门ID
  yearMonthValue: string // 考核月份
  assessmentScore: number // 考核分数
  assessmentLevel: string // 考核等级
  basePerformance: number // 基准绩效金额
  actualPerformance: number // 实际绩效金额
  performanceRatio: number // 绩效系数
  assessmentComment: string // 考核评语
  assessorId: string // 考核人ID
  assessorName: string // 考核人姓名
  assessTime: Date // 考核时间
  approverId: string // 审批人ID
  approverName: string // 审批人姓名
  approveTime: Date // 审批时间
  approveStatus: number // 审批状态
  remark: string // 备注
}

// 考核工资明细 API
export const HrSalaryAssessmentApi = {
  // 查询考核工资明细分页
  getHrSalaryAssessmentPage: async (params: any) => {
    return await request.get({ url: `/bpm/hr-salary-assessment/page`, params })
  },

  // 查询考核工资明细详情
  getHrSalaryAssessment: async (id: number) => {
    return await request.get({ url: `/bpm/hr-salary-assessment/get?id=` + id })
  },

  // 新增考核工资明细
  createHrSalaryAssessment: async (data: HrSalaryAssessmentVO) => {
    return await request.post({ url: `/bpm/hr-salary-assessment/create`, data })
  },

  // 修改考核工资明细
  updateHrSalaryAssessment: async (data: HrSalaryAssessmentVO) => {
    return await request.put({ url: `/bpm/hr-salary-assessment/update`, data })
  },

  // 删除考核工资明细
  deleteHrSalaryAssessment: async (id: number) => {
    return await request.delete({ url: `/bpm/hr-salary-assessment/delete?id=` + id })
  },

  // 导出考核工资明细 Excel
  exportHrSalaryAssessment: async (params) => {
    return await request.download({ url: `/bpm/hr-salary-assessment/export-excel`, params })
  },
}
